package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.wap.dao.IFpShopInformationDzDao;
import com.financing.wap.dto.FpShopInformationDzDTO;
import com.financing.wap.service.IFpShopInformationDzService;
import com.financing.wap.util.DTOdateSetUtil;
/**
 * fp_shop_information_dz  
 *  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopInformationDzService")
public class FpShopInformationDzServiceImpl implements IFpShopInformationDzService{

	@Autowired
	private IFpShopInformationDzDao fpShopInformationDzDao;

	@Override
	public int insert(FpShopInformationDzDTO fpShopInformationDz) throws SQLException {
		DTOdateSetUtil.setCreateInfo(fpShopInformationDz);
		DTOdateSetUtil.setUpdateInfo(fpShopInformationDz);
		fpShopInformationDz.setDeleteTag("1");
		return fpShopInformationDzDao.insert(fpShopInformationDz);
	}

	@Override
	public void update(FpShopInformationDzDTO fpShopInformationDz) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopInformationDz);
		fpShopInformationDzDao.update(fpShopInformationDz);
	}

	@Override
	public void updateForce(FpShopInformationDzDTO fpShopInformationDz) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopInformationDz);
		fpShopInformationDzDao.updateForce(fpShopInformationDz);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpShopInformationDzDao.delete(id);
	}
	
	@Override
	public List<FpShopInformationDzDTO> queryList(FpShopInformationDzDTO fpShopInformationDz) throws SQLException {
		return fpShopInformationDzDao.queryList(fpShopInformationDz);
	}

	@Override
	public int queryListCount(FpShopInformationDzDTO fpShopInformationDz) throws SQLException {
		return fpShopInformationDzDao.queryListCount(fpShopInformationDz);
	}

	@Override
	public FpShopInformationDzDTO loadById(Integer id) throws SQLException {
		return fpShopInformationDzDao.loadById(id);
	}
 	@Override
	public FpShopInformationDzDTO queryListGetFirst(FpShopInformationDzDTO fpShopInformationDz)
			throws SQLException {
		 List<FpShopInformationDzDTO> queryList = queryList(fpShopInformationDz);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopInformationDzDTO();
		 }
		 return queryList.get(0);
	}
}
